<?php

include_once '../../Core/Conexion.php';
include_once '../../Core/ControladorSet.php';
include_once '../../Core/InterfazDatos.php';
///****
include_once '../entidades/Curso.php';
include_once '../entidades/Institucion.php';
include_once '../entidades/Periodo.php';

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of lista
 *
 * @author cHr15t14n
 */
class lista extends ControladorSet {

    public function buscarValores() {
        $cadena="";
        $consulta=$this->conexion->consultaLibre("SELECT * FROM CURSO C,INSTITUCION I WHERE C.IDINSTITUCION=I.IDINSTITUCION ORDER BY I.NOMBRE");
        $fila=  mysql_fetch_array($consulta);
        do
        {
            $cadena=$cadena."<tr>";
                $cadena=$cadena."<td>".$fila[2]."</td>";
                $cadena=$cadena."<td>".$fila[7]."</td>";
                $cadena=$cadena."<td>".$fila[3]."</td>";
                $cadena=$cadena."<td>".$fila[4]."</td>";
                 $cadena = $cadena . "<td>" . "<a href=editar.php?codigo=" . $fila[0] . " >edit<a>" . "</td>";
          $cadena = $cadena . "<td>" . "<a onclick='return confirm(\"Seguro que desea eliminar estos datos?\");' href=php/Eliminar.php?codigo=" . $fila[0] . " >elimr<a>" . "</td>";
                
            $cadena=$cadena."</tr>";
        }while($fila=  mysql_fetch_array($consulta));
        $this->diccionario['tabla']=$cadena;
        
    }

    public function setDiccionario() {
        $this->diccionario = array(
            "tabla" => "vacio",
        );
    }

    public function setValorSesion() {
        $this->valorSesion = array("admin", "", "");
    }

//put your code here
}

$controlador = new lista('listaVista.php');
$controlador->rederizarPagina();
